import { RouteRecordRaw } from 'vue-router'
export const constantRoute: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'layout',
    redirect: 'home',
    component: () => import('@/layout/index.vue'),
    children: [
      {
        path: '/error',
        name: 'error',
        meta: {
          title: '404',
        },
        component: () => import('@/views/error/index.vue'),
      },
      {
        path: '/home',
        name: 'home',
        props: true,
        meta: {
          title: '首页',
        },
        component: () => import('@/views/home/index.vue'),
      },
      {
        path: '/job',
        name: 'job',
        props: true,
        meta: {
          title: '职位',
        },
        component: () => import('@/views/job/index.vue'),
      },
      {
        path: '/company',
        name: 'company',
        props: true,
        meta: {
          title: '公司',
        },
        component: () => import('@/views/company/index.vue'),
      },
      {
        path: '/info/job/:id',
        name: 'jobInfo',
        props: true,
        meta: {
          title: '职位详情',
        },
        component: () => import('@/views/jobDetail/index.vue'),
      },
      {
        path: '/info/company/:id',
        name: 'companyInfo',
        props: true,
        meta: {
          title: '公司详情',
        },
        component: () => import('@/views/companyDetail/index.vue'),
      },
      {
        path: '/resume',
        name: 'resume',
        props: true,
        meta: {
          title: '我的简历',
        },
        component: () => import('@/views/resume/index.vue'),
      },
      {
        path: '/process',
        name: 'process',
        props: true,
        meta: {
          title: '我的投递',
        },
        component: () => import('@/views/process/index.vue'),
      },
      {
        path: '/setting',
        name: 'setting',
        props: true,
        meta: {
          title: '我的设置',
        },
        component: () => import('@/views/setting/index.vue'),
      },
      {
        path: '/chat',
        name: 'chat',
        props: true,
        meta: {
          title: '聊天',
        },
        component: () => import('@/views/chat/index.vue'),
      },
    ],
  },
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录',
    },
    component: () => import('@/views/login/index.vue'),
  },
  {
    path: '/register/hr',
    name: 'HR注册',
    component: () => import('@/views/register/hrRegister.vue'),
  },
  {
    path: '/register/jobSeeker',
    name: '求职者注册',
    component: () => import('@/views/register/jobSeekerRegister.vue'),
  },
  {
    path: '/register/selectUserRole',
    name: '选择注册角色',
    component: () => import('@/views/register/selectUserRole.vue'),
  },
]

export const asyncRoute: RouteRecordRaw[] = [
  {
    path: '/hr',
    name: 'hrLayout',
    redirect: 'hr',
    component: () => import('@/hrLayout/index.vue'),
    children: [
      {
        path: '/hr/404',
        name: 'hr404',
        meta: {
          title: '404',
        },
        component: () => import('@/views/error/index.vue'),
      },
      {
        path: '/hr/home',
        name: 'hrhome',
        meta: {
          title: 'HR首页',
        },
        component: () => import('@/views/hrHome/index.vue'),
      },
      {
        path: '/hr/job',
        name: 'hrjob',
        props: true,
        meta: {
          title: '职位',
        },
        component: () => import('@/views/hrHome/viewJob.vue'),
      },
      {
        path: '/hr/company',
        name: 'hrcompany',
        props: true,
        meta: {
          title: '公司',
        },
        component: () => import('@/views/hrHome/viewCompany.vue'),
      },
      {
        path: '/hr/info/job/:id',
        name: 'hrjobInfo',
        props: true,
        meta: {
          title: '职位详情',
        },
        component: () => import('@/views/hrHome/jobDetail.vue'),
      },
      {
        path: '/hr/info/company/:id',
        name: 'hrcompanyInfo',
        props: true,
        meta: {
          title: '公司详情',
        },
        component: () => import('@/views/hrHome/companyDetail.vue'),
      },
      {
        path: '/hr/resume',
        name: 'hrResume',
        props: true,
        meta: {
          title: '查看简历',
        },
        component: () => import('@/views/hrHome/receiveResume.vue'),
      },
      {
        path: '/hr/postJob',
        name: 'hrJob',
        props: true,
        meta: {
          title: '发布职位',
        },
        component: () => import('@/views/hrHome/postJobs.vue'),
      },
      {
        path: '/hr/myCompany',
        name: 'hrCompany',
        props: true,
        meta: {
          title: '我的公司',
        },
        component: () => import('@/views/hrHome/myCompany.vue'),
      },
      {
        path: '/hr/personalProfile',
        name: 'hrPersonalProfile',
        props: true,
        meta: {
          title: '个人信息',
        },
        component: () => import('@/views/hrHome/personalProfile.vue'),
      },
      {
        path: '/hr/myChat',
        name: 'hrChat',
        props: true,
        meta: {
          title: '我的聊天',
        },
        component: () => import('@/views/hrHome/myChat.vue'),
      },
      {
        path: '/hr/recruitProcess',
        name: 'hrRecruitProcess',
        props: true,
        meta: {
          title: '招聘流程',
        },
        component: () => import('@/views/hrHome/recruitProcess.vue'),
      },
    ],
  },
]
export const anyRoute: RouteRecordRaw[] = [
  {
    //任意路由
    path: '/:pathMatch(.*)*',
    redirect: '/error',
    name: 'Any',
    meta: {
      title: '任意路由',
      hidden: true,
      icon: 'DataLine',
    },
  },
]
